#ifndef __VOCABULARY_HH__
#define __VOCABULARY_HH__

#include <map>
#include <string>
using namespace std;

#include "Tokenizer.hh"

class Vocabulary{
public:
  Vocabulary();
  /**
   * For all tokens, adds to vocabulary.
   */
  void add_to_vocabulary(vector<string> &);
  /**
   * Maps a single id to the corresponding token.
   */
  string map_to_token(int);
  /**
   * Maps a single token to the corresponding id.
   */
  int map_to_id(string &);
  /**
   * Maps a number of ids to the corresponding tokens.
   */
  void map_to_tokens(vector<int> &, vector<string> &);
  /**
   * Maps a number of tokens to the corresponding ids.
   */
  void map_to_ids(vector<string> &, vector<int> &);
 
private:
  map<string, int> token_to_id;
  map<int, string> id_to_token;
  int id_so_far;
};

#endif
